<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>循环</title>
</head>
<body>
    <script>
        // 停止循环有两种:continue(跳过本次循环)和break(结束当前循环)

        // 1.while循环
        let k = 1
        while(k <= 100){
            document.write(`${k}<br>`)
            k++
        }

        // 2.for循环
        for(let j = 1; j <= 9; j++){
            // 里层循环控制每一行星星的个数
            for(let i = 1; i <= j; i++){
                // 规律是j和i是自增的，1,2,3,4.....9
                document.write(`<span>${i} * ${j} = ${i*j}</span> `)
            }
            document.write('<br>')
        }

    </script>
</body>
</html>